import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/cupertino.dart' hide Action;
import 'package:www.znpigai.teacher/global_store/state.dart';

import 'action.dart';
import 'state.dart';

Effect<BootGuideState> buildEffect() {
  return combineEffects(<Object, Effect<BootGuideState>>{
    BootGuideAction.onDone: _onDone,
  });
}

Future _onDone(Action action, Context<BootGuideState> ctx) async {
  GlobalState.isFirstBoot = false;
  Navigator.of(ctx.context).pushNamedAndRemoveUntil(
      GlobalState.getHomePage(), (Route<dynamic> route) => false);
}
